<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>我的订单</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="css/mui.min.css">
		<link rel="stylesheet" href="css/my-order.css">
		<style>
			html,
			body {
				background-color: #efeff4;
			}
			.mui-bar~.mui-content .mui-fullscreen {
				top: 44px;
				height: auto;
			}
			.mui-pull-top-tips {
				position: absolute;
				top: -20px;
				left: 50%;
				margin-left: -25px;
				width: 40px;
				height: 40px;
				border-radius: 100%;
				z-index: 1;
			}
			.mui-bar~.mui-pull-top-tips {
				top: 24px;
			}
			.mui-pull-top-wrapper {
				width: 42px;
				height: 42px;
				display: block;
				text-align: center;
				background-color: #efeff4;
				border: 1px solid #ddd;
				border-radius: 25px;
				background-clip: padding-box;
				box-shadow: 0 4px 10px #bbb;
				overflow: hidden;
			}
			.mui-pull-top-tips.mui-transitioning {
				-webkit-transition-duration: 200ms;
				transition-duration: 200ms;
			}
			.mui-pull-top-tips .mui-pull-loading {
				/*-webkit-backface-visibility: hidden;
				-webkit-transition-duration: 400ms;
				transition-duration: 400ms;*/
				
				margin: 0;
			}
			.mui-pull-top-wrapper .mui-icon,
			.mui-pull-top-wrapper .mui-spinner {
				margin-top: 7px;
			}
			.mui-pull-top-wrapper .mui-icon.mui-reverse {
				/*-webkit-transform: rotate(180deg) translateZ(0);*/
			}
			.mui-pull-bottom-tips {
				text-align: center;
				background-color: #efeff4;
				font-size: 15px;
				line-height: 40px;
				color: #777;
			}
			.mui-pull-top-canvas {
				overflow: hidden;
				background-color: #fafafa;
				border-radius: 40px;
				box-shadow: 0 4px 10px #bbb;
				width: 40px;
				height: 40px;
				margin: 0 auto;
			}
			.mui-pull-top-canvas canvas {
				width: 40px;
			}
			.mui-slider-indicator.mui-segmented-control {
				background-color: #efeff4;
			}
			.mui-pull-bottom-tips{
				background: white;
			}
			/*.mui-control-item{
				width: 20%!important;
				padding: 0!important;
			}
			.mui-scroll{
				width: 100%!important;
				font-size: .65rem;
			}*/
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<span class="order-back mui-action-back"><img src="img/back-le.png" height="50%"/></span>
			<h1 class="mui-title1 mui-title">我的订单</h1>
		</header>
		<div class="mui-content">
			<div id="slider" class="mui-slider mui-fullscreen" style="background-color: white;">
				<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
					<div class="mui-scroll tanxuan">
						<a class="mui-control-item mui-active " href="#item1mobile">
							全部
						</a>
						<a class="mui-control-item col-20" href="#item2mobile">
							待付款
							<span id="b0" class=" mui-badge1 "></span>
						</a>
						<a class="mui-control-item col-20" href="#item3mobile">
							待发货
							<span id="b1" class=" mui-badge1 "></span>
						</a>
						<a class="mui-control-item col-20" href="#item4mobile">
							待收货
							<span id="b2" class=" mui-badge1 "></span>
						</a>
						<a class="mui-control-item col-20" href="#item5mobile">
							待评价
							<span id="b3" class=" mui-badge1 "></span>
						</a>
					</div>
				</div>
				<div class="mui-slider-group">
					
					<div id="item1mobile" class="mui-slider-item mui-control-content mui-active">
						<div id="scroll1" class="mui-scroll-wrapper" sid='1'>
							<div class="mui-scroll">
								<ul class="mui-table-view">
									<div class="a0"></div>
								</ul>
							</div>
						</div>
					</div>
					
					<div id="item2mobile" class="mui-slider-item mui-control-content">
						<div class="mui-scroll-wrapper" sid='1'>
							<div class="mui-scroll">
								<ul class="mui-table-view">
									<div class="a1"></div>
								</ul>
							</div>
						</div>
					</div>
					
					<div id="item3mobile" class="mui-slider-item mui-control-content">
						<div class="mui-scroll-wrapper" sid='1'>
							<div class="mui-scroll">
								<ul class="mui-table-view">
									<div class="a2"></div>
								</ul>
							</div>
						</div>
					</div>
					
					<div id="item4mobile" class="mui-slider-item mui-control-content">
						<div class="mui-scroll-wrapper" sid='1'>
							<div class="mui-scroll">
								<ul class="mui-table-view">
									<div class="a3"></div>
								</ul>
							</div>
						</div>
					</div>
					
					<div id="item5mobile" class="mui-slider-item mui-control-content">
						<div class="mui-scroll-wrapper" sid='1'>
							<div class="mui-scroll">
								<ul class="mui-table-view">
									<div class="a4"></div>
								</ul>
							</div>
						</div>
					</div>
					
				</div>
			</div>
		</div>
		<script src='js/jquery-3.1.1.min.js'></script>
		<script src="js/url.js"></script>
		<script src="js/mui.min.js"></script>
		<script src="js/mui.pullToRefresh.js"></script>
		<script src="js/mui.pullToRefresh.material.js"></script>
		<script>
						
			mui.init();
			(function($) {
				//阻尼系数
				var deceleration = mui.os.ios?0.003:0.0009;
				$('.mui-scroll-wrapper').scroll({
					bounce: false,
//					indicators: true, //是否显示滚动条
					deceleration:deceleration
				});
				$.ready(function(){
					//循环初始化所有下拉刷新，上拉加载。
					$.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function(index, pullRefreshEl) {
						$(pullRefreshEl).pullToRefresh({
							down: {
								callback: function(){
									var self = this;
									setTimeout(function(){
//										var ul = self.element.querySelector('.mui-table-view');
//										ul.insertBefore(createFragment(ul, index, 10, true), ul.firstChild);
                                        
                                        updataallsx();
										self.endPullDownToRefresh();
									}, 1000);
								}
							},
							
							up: {
								callback: function(){
									var self = this;
									setTimeout(function(){
//										var ul = self.element.querySelector('.mui-table-view');
//										ul.appendChild(createFragment(ul, index, 5));
                                    
                                        if(sessionStorage.ifhaveor == 0){
//                                      	mui.toast('没有更多');
                                        	
//                                      	$('.mui-pull-loading').text('没有更多');
                                        	document.getElementsByClassName('mui-pull-loading').innerHTML = '没有更多';
                                        	self.endPullUpToRefresh();
                                        }else if(sessionStorage.ifhaveor == 1){
                                        	updataalljz();
										  self.endPullUpToRefresh();
                                        }
                                        
									}, 1000);
								}
							}
						});
					});
//					var createFragment = function(ul, index, count, reverse) {
//						var length = ul.querySelectorAll('li').length;
//						var fragment = document.createDocumentFragment();
//						var li;
////						for (var i = 0; i < count; i++) {
////							li = document.createElement('li');
////							li.className = 'mui-table-view-cell';
////							li.innerHTML = '第' + (index + 1) + '个选项卡子项-' + (length + (reverse ? (count - i) : (i + 1)));
////							fragment.appendChild(li);
////						}
//						return fragment;
//					};
				});
			})(mui);
			
			
			
			document.addEventListener('sxzf', function() {
				$('.a1').html('');
				$('.a2').html('');
				$('.a3').html('');
				$('.a4').html('');
				$('.a0').html('');
				var guepage = 1;
				orderList();
			})

			$('.mui-slider-group').on('tap', '.order', function(event) {
				event.stopPropagation();
				//          	alert($(this).attr('oid'));
				localStorage.deorderid = $(this).attr('oid');
				mui.openWindow({
					url: 'my-order_de.html',
					id: 'order_de',
					show: 'pop-in'
				});
			})

				clist();
				sessionStorage.ifhaveor = 1;
				document.querySelector('.mui-scroll-wrapper').addEventListener('scroll', function(e) {
                     sessionStorage.ifhaveor = 1;
				  if($('.tanxuan>a').eq(0).hasClass('mui-active')){
//				  	alert(1);
				  	localStorage.status = ''
				  	updataallsx();
				  }else if($('.tanxuan>a').eq(1).hasClass('mui-active')){
				  	localStorage.status = 1;
				  	updataallsx();
//				  	alert(2);
				  }else if($('.tanxuan>a').eq(2).hasClass('mui-active')){
//				  	alert(3);
				  	localStorage.status = 2;
				  	updataallsx();
				  }else if($('.tanxuan>a').eq(3).hasClass('mui-active')){
//				  	alert(4);
				  	localStorage.status = 3;
				  	updataallsx();
				  }else if($('.tanxuan>a').eq(4).hasClass('mui-active')){
//				  	alert(5);
				  	localStorage.status = 5;
				  	updataallsx();
				  }
				  
				});
//			});

            var guepage = 1;
			var status_tab = localStorage.status_tab;
			$('.tanxuan>a').eq(status_tab).addClass('mui-active');
			$('.tanxuan>a').eq(status_tab).siblings().removeClass('mui-active');	
//			$('.tanxuan>a').eq(status_tab).siblings().addClass('borderbo');
			$('.mui-slider-group>div').eq(status_tab).addClass('mui-active');
			$('.mui-slider-group>div').eq(status_tab).siblings().removeClass('mui-active');
			window.addEventListener('uporder', function(event) {
				$('.a1').html('');
				$('.a2').html('');
				$('.a3').html('');
				$('.a4').html('');
				$('.a0').html('');
				var guepage = 1;
				orderList();
			});
			
			
			function clist() {
				var guepage = 1;
				if(localStorage.status_tab == 1) {
					localStorage.status = 1;
					orderList();
				} else if(localStorage.status_tab == 2) {
					localStorage.status = 2;
					orderList();
				} else if(localStorage.status_tab == 3) {
					localStorage.status = 3;
					orderList();
				} else if(localStorage.status_tab == 4) {
					localStorage.status = 5;
					orderList();
				} else if(localStorage.status_tab == 0) {
					localStorage.status = '';
					orderList();
				}

				//		           alert(localStorage.status+'275');
				console.log(localStorage.status);

			}

			//				})

			
//          上拉加载代码
			function updataalljz() {
				orderList();
			}
			
//			下拉刷新代码
			function updataallsx() {
				$('.a1').html('');
				$('.a2').html('');
				$('.a3').html('');
				$('.a4').html('');
				$('.a0').html('');
                guepage = 1;
				orderList();
			}
			
			
			
			
			
			
			function orderList() {
//               alert(11);
				$.ajax({
					//					url: ur + 'mobilemember/frontOrder/orderlist',
					url: ur + '/mobilemember/frontOrder/orderlist?time=' + new Date(),
					type: 'post',
					dataType: 'json',
					headers: {
						'X-Token': localStorage.token,
					},
					data: {
						'orderVO.status': localStorage.status,
						'numPerPage':10,
						'pageNum':guepage,
						'pageRequest':1
						//								'status':status
					},
					success: function(data) {
						if(guepage==data.paginator.totalPage){
							sessionStorage.ifhaveor = 0;
							$('.mui-pull-loading').text('没有更多');
						 }else if(guepage<data.paginator.totalPage){
						 	sessionStorage.ifhaveor = 1;
						 }
						//商品叠加
                        guepage++;
						//								console.log(m+'第二个的长度');
						if(data.result.meta.code == 201 && data.paginator.totalCount==0) {
                            var a = JSON.stringify(data.statusNum);
							var b = (a.replace('[', '').replace(']', '')).split(',');
							console.log(b.length);
							console.log(b[0]);
							if(b[0] != 0) {
								$('#b0').css('display','block');
								$('#b0').text(b[0]);
							}else if(b[0] == 0){
								$('#b0').css('display','none');
							}
							if(b[1] != 0) {
								$('#b1').css('display','block');
								$('#b1').text(b[1]);
							}else if(b[1] == 0){
								$('#b1').css('display','none');
							}
							if(b[2] != 0) {
								$('#b2').css('display','block');
								$('#b2').text(b[2]);
							}else if(b[2] == 0){
								$('#b2').css('display','none');
							}
							if(b[3] != 0) {
								$('#b3').css('display','block');
								$('#b3').text(b[3]);
							}else if(b[3] == 0){
								$('#b3').css('display','none');
							}
							var divimg = ('<div style="margin:5rem auto 0;text-align: center;"><img style="width:35%;" src="img/nogood.png"><p style="color:#6a6a6a;font-size: .8rem;">您还没有此类型的订单</p></div>');
							if(localStorage.status == 1) {
								$('.a1').html('');
								$('.a1').append(divimg);
							} else if(localStorage.status == 2) {
								$('.a2').html('');
								$('.a2').append(divimg);
							} else if(localStorage.status == 3) {
								$('.a3').html('');
								$('.a3').append(divimg);
							} else if(localStorage.status == 5) {
								$('.a4').html('');
								$('.a4').append(divimg);
							} else if(localStorage.status == '') {
								$('.a0').html('');
								$('.a0').append(divimg);
							}
							$('.mui-pull-loading').text('没有更多');
						}else if(data.result.meta.code == 201 && data.paginator.totalCount!=0){
							$('.mui-pull-loading').text('没有更多');
						}else if(data.result.meta.code == 200) {
							var a = JSON.stringify(data.statusNum);
							var b = (a.replace('[', '').replace(']', '')).split(',');
							console.log(b.length);
							console.log(b[0]);
							if(b[0] != 0) {
								$('#b0').css('display','block');
								$('#b0').text(b[0]);
							}else if(b[0] == 0){
								$('#b0').css('display','none');
							}
							if(b[1] != 0) {
								$('#b1').css('display','block');
								$('#b1').text(b[1]);
							}else if(b[1] == 0){
								$('#b1').css('display','none');
							}
							if(b[2] != 0) {
								$('#b2').css('display','block');
								$('#b2').text(b[2]);
							}else if(b[2] == 0){
								$('#b2').css('display','none');
							}
							if(b[3] != 0) {
								$('#b3').css('display','block');
								$('#b3').text(b[3]);
							}else if(b[3] == 0){
								$('#b3').css('display','none');
							}
							var n = data.result.data.length;
							var m = data.result.data[0].length;
							console.log(data.result.data.length + 'n');
							console.log(data.result.data[0].length + 'm');
							for(var i = 0; i < n; i++) {
								var howjian = 0;
								var allpric = 0;
								var divall = $('<li class="order" id="daifukuan" oid="' + data.result.data[i][0].orderId + '" Nid="' + data.result.data[i][0].orderNum + '">' +
									'<div class="main" id="order1">' +
									'<div class="order-header clearfix">' +
									'<div class="pull-left order-info">' +
									'<p>' + '店铺名称：' + data.result.data[i][0].shopName + '</p>' +
									'<p class="order-code">' + '订单编号：' + data.result.data[i][0].orderNum + '</p>' +
									'</div>' +
									'<div class="pull-rightzt">' +
									'<a class="fukuan' + i + guepage+ '' + 0 + ' fukuan"></a>' +
									'</div>' +
									'</div>' +
									'<div class="order-all' + i + guepage+'">' +

									'</div>' +
									'<div class="order-footer clearfix">' +
									'<span class="pull-rightmon">共<span class="howjian' + i + guepage+ ' howjian"></span>件商品&nbsp;&nbsp;&nbsp;&nbsp;合计：¥' + '<i style="margin-left: 5px" class="order-total allpric' + i + guepage+ '">' + data.result.data[i][0].orderPrice + '</i>&nbsp;&nbsp</span>' +
									//									'(含运费￥' + (data.result.data[i][0].freight==undefined?data.result.data[i][0].freight:0) + ')</span>' +
									'<span class="yfspana yf'+ i + guepage+'">运费:<span class="yfspan'+ i + guepage+'"></span></span>' +
									'</div>' +
									'<div class="order-vfooter clearfix">' +
									'<span class="pull-left order-time">' + data.result.data[i][0].createTime.substring(0, 10) + '</span>' +
									'<span class="pull-right"><button class="delete' + i + guepage+'' + 0 + ' delete" tai="' + data.result.data[i][0].status + '"></button><button ifconf="' + data.result.data[i][0].isConfirm + '" class="payment' + i + guepage+ '' + 0 + ' payment" tai="' + data.result.data[i][0].status + '"></button></span>' +
									
									'</div>' +
									'</div>' +
									'</li>'
								);
								if(localStorage.status == 1) {
									//									$('.a1').html('');
									$('.a1').append(divall);
									$('.fukuan' + i + guepage+ '' + 0 + '').text('等待买家付款');
									$('.delete' + i + guepage+ '' + 0 + '').text('取消订单');
									$('.payment' + i + guepage+ '' + 0 + '').text('立即支付');
								} else if(localStorage.status == 2 || localStorage.status == 19) {
									//									$('.a2').html('');
									$('.a2').append(divall);
									$('.fukuan' + i + guepage+ '' + 0 + '').text('买家已付款');
									$('.delete' + i + guepage+ '' + 0 + '').text('申请退款');
									$('.payment' + i + guepage+ '' + 0 + '').text('提醒发货');
									
									if($('.payment' + i + guepage+ '' + 0 + '').attr('ifconf')==0){
										$('.payment' + i + guepage+ '' + 0 + '').text('确认订单');
										$('.payment' + i + guepage+ '' + 0 + '').removeClass('payment').addClass('confirmOrder');
									}else if($('.payment' + i + guepage+ '' + 0 + '').attr('ifconf')==1){
										$('.payment' + i + guepage+ '' + 0 + '').text('提醒发货');
										$('.payment' + i + guepage+ '' + 0 + '').removeClass('confirmOrder').addClass('payment');
									}

								} else if(localStorage.status == 3) {
									//									$('.a3').html('');
									$('.a3').append(divall);
									$('.fukuan' + i + guepage+ '' + 0 + '').text('卖家已发货');
									$('.delete' + i + guepage+ '' + 0 + '').text('查看物流');
									$('.payment' + i + guepage+ '' + 0 + '').text('确认收货');
								} else if(localStorage.status == 5) {
									//									$('.a4').html('');
									$('.a4').append(divall);
									$('.fukuan' + i + guepage+ '' + 0 + '').text('交易成功');
									$('.delete' + i + guepage+ '' + 0 + '').text('删除订单');
									$('.payment' + i + guepage+ '' + 0 + '').css('display', 'none');
								} else if(localStorage.status == '') {
									//									$('.a0').html('');
									$('.a0').append(divall);
									if(data.result.data[i][0].status == 1) {
										//									$('.a1').html('');
										$('.a0').append(divall);
										$('.fukuan' + i + guepage+ '' + 0 + '').text('等待买家付款');
										$('.delete' + i + guepage+ '' + 0 + '').text('取消订单');
										$('.payment' + i + guepage+ '' + 0 + '').text('立即支付');
									} else if(data.result.data[i][0].status == 2 || data.result.data[i][0].status == 19) {
										//									$('.a2').html('');
										$('.a0').append(divall);
										$('.fukuan' + i + guepage+ '' + 0 + '').text('买家已付款');
										$('.delete' + i + guepage+ '' + 0 + '').text('申请退款');
										$('.payment' + i + guepage+ '' + 0 + '').text('提醒发货');
										
										if($('.payment' + i + guepage+ '' + 0 + '').attr('ifconf')==0){
											$('.payment' + i + guepage+ '' + 0 + '').text('确认订单');
											$('.payment' + i + guepage+ '' + 0 + '').removeClass('payment').addClass('confirmOrder');
										}else if($('.payment' + i + guepage+ '' + 0 + '').attr('ifconf')==1){
											$('.payment' + i + guepage+ '' + 0 + '').text('提醒发货');
											$('.payment' + i + guepage+ '' + 0 + '').removeClass('confirmOrder').addClass('payment');
										}
										
									} else if(data.result.data[i][0].status == 3) {
										//									$('.a3').html('');
										$('.a0').append(divall);
										$('.fukuan' + i + guepage+ '' + 0 + '').text('卖家已发货');
										$('.delete' + i + guepage+ '' + 0 + '').text('查看物流');
										$('.payment' + i + guepage+ '' + 0 + '').text('确认收货');
									} else if(data.result.data[i][0].status == 5) {
										//									$('.a4').html('');
										$('.a0').append(divall);
										$('.fukuan' + i + guepage+ '' + 0 + '').text('交易成功');
										$('.delete' + i + guepage+ '' + 0 + '').text('删除订单');
										$('.payment' + i + guepage+ '' + 0 + '').css('display', 'none');
									} else if(data.result.data[i][0].status == 11) {
										//									$('.a2').html('');
										$('.a0').append(divall);
										$('.fukuan' + i + guepage+ '' + 0 + '').text('交易关闭');
										$('.delete' + i + guepage+ '' + 0 + '').text('删除订单');
										$('.payment' + i + guepage+ '' + 0 + '').css('display', 'none');
									} else if(data.result.data[i][0].status == 9) {
										//									$('.a2').html('');
										$('.a0').append(divall);
										$('.fukuan' + i + guepage+ '' + 0 + '').text('交易关闭');
										$('.delete' + i + guepage+ '' + 0 + '').text('删除订单');
										$('.payment' + i + guepage+ '' + 0 + '').css('display', 'none');
									} else if(data.result.data[i][0].status == 12) {
										//									$('.a2').html('');
										$('.a0').append(divall);
										$('.fukuan' + i + guepage+ '' + 0 + '').parents('#daifukuan').css('display', 'none');
										//										$('.delete' + i + '' + 0 + '').text('删除订单');
										//										$('.payment' + i + '' + 0 + '').css('display', 'none');
									} else if(data.result.data[i][0].status == 13) {
										//									$('.a2').html('');
										$('.a0').append(divall);
										//										$('.fukuan' + i + '' + 0 + '').parents('#daifukuan').css('display', 'none');
										$('.fukuan' + i + guepage+ '' + 0 + '').text('退款中');
										$('.delete' + i + guepage+ '' + 0 + '').css('display', 'none');
										$('.payment' + i + guepage+ '' + 0 + '').css('display', 'none');
										//										$('.delete' + i + '' + 0 + '').text('删除订单');
										//										$('.payment' + i + '' + 0 + '').css('display', 'none');
									}
									//									$('.fukuan').text('交易成功');
									//									$('.delete').text('删除订单');
									//									$('.payment').text('待评价');
								}
								//							console.log(n + '循环第yi个的长度');
								for(var j = 0; j < data.result.data[i].length; j++) {
									//								console.log(data.result.data[i].length+j + '循环第二个的长度');
									//								var money_z = data.result.data[i][j].price * data.result.data[i][j].amount;
									//								$('.allpric'+i+'').text(money_z);
									var b = data.result.data[i][j].photoPath;
									console.log(b.indexOf(',') + '逗号索引值');
									var m = b.indexOf(',');
									if(m != '-1') {
										var mainImg = b.substring(0, m);
									} else {
										mainImg = b;
									}
									
									var div = $(
										'<div class="order-body">' +
										'<div class="product">' +
										'<div class="p-img" style="background-image:url(' + picur + mainImg + ');background-position:center;background-repeat:no-repeat;background-size:cover;"></div>' +
										'<div class="details"><p>' + data.result.data[i][j].shorName + '</p><p>' + data.result.data[i][j].size + '</p></div>' +
										'<div class="details_ri">' +
										'<p>￥' + data.result.data[i][j].price + '</p>' +
										'<p><del>￥' + data.result.data[i][j].oriPrice + '</del></p>' +
										'<p style="font-size: .6rem;">X<span style="font-size: 1rem;">' + data.result.data[i][j].amount + '</span></p>' +
//										'<p class="yf'+ i + guepage+''+j+'">运费:<span>'+ data.result.data[i][j].freight +'</span></p>' +
										'</div>' +
										'</div>' +
										'</div>'
									);
									$('.order-all' + i +  guepage+'').append(div);
									
									
									
									
									
									if(data.result.data[i][j].price==data.result.data[i][j].oriPrice){
										$('.yuanjia'+ i + guepage+''+j+'').css('display','none');
										
										
									}else if(data.result.data[i][j].price!=data.result.data[i][j].oriPrice){
										$('.pr1'+ i + guepage+''+j+'').text(data.result.data[i][j].Price);
										$('.pr2'+ i + guepage+''+j+'').text(data.result.data[i][j].oriprice);
									}
									
									if(data.result.data[i][j].shorName=='会员充值'){
										$('.order-all' + i + guepage + '').parent().parent().css('display','none');
									}
									//console.log(data.result.data[i][j].proVal);
									//(data.result.data[i][j].proVal==undefined||data.result.data[i][j].proVal=="null"?data.result.data[i][j].proVal:'')
									
//									if(data.result.data[i][j].proVal == "undefined" || data.result.data[i][j].proVal == null) {
//										//									alert(1);
//										//									alert($('.d'+i+''+j+''));
//										//										console.log($('.d' + i + '' + j + ''));
//										$('.d' + i +guepage+ '' + j + '').css('display', 'none');
//									}
									if(data.result.data[i][0].freight == "undefined" || data.result.data[i][0].freight == null) {
										//									alert(1);
										//									alert($('.d'+i+''+j+''));
										//										console.log($('.d' + i + '' + j + ''));
										$('.yf'+ i + guepage+'').css('display', 'none');
									}else{
										$('.yfspan'+ i + guepage+'').text(data.result.data[i][0].freight);
									}
									
									howjian = howjian + data.result.data[i][j].amount;
//									allpric = allpric + bigerp * data.result.data[i][j].amount ;
									$('.howjian' + i + guepage+ '').text(howjian);
								}
							}
						}
					},
					error: function(e) {
						console.log(JSON.stringify(e) + '<<<<错误');
					}
				})
			}
			
			
			/*确认订单按钮点击*/
			$('.mui-slider-group').on('tap','.confirmOrder',function(event){
				event.stopPropagation();
				var tai = $(this).attr('tai');
				var thisid = $(this).parents('.order').attr('oid');
				
				var btnArray = ['否', '是'];
					mui.confirm('确认订单之后就不能退货或退款，确认？', '魏远商城', btnArray, function(e) {

						if(e.index == 1) {
							//				alert(thisid);
							$.ajax({
								url: ur + '/mobilemember/frontOrderOperation/cofrimOrder',
								type: 'post',
								headers: {
									"X-Token": localStorage.token
								},
								dataType: 'json',
								data: {
									"orderVO.id": thisid,
									/*"id": '40288051594f367a015963128b240033',*/
								},
								success: function(data) {
//									alert(3)
									
								},
								error: function(data) {

									console.log(data);
								}
							})
						}
					})
			})
			
			
			
			/*第一个按钮点击*/
			$('.mui-slider-group').on('tap', '.delete', function(event) {
				
//									console.log(parseInt(n) - 1+'数量');
				event.stopPropagation();
				//				 event.stopPropagation();
				var tai = $(this).attr('tai');
//				alert(tai);
				if(tai == 1) {

					/*取消订单*/
					var thisid = $(this).parents('.order').attr('oid');
					console.log($(this));
					//                    alert(thisid);
					var all = $(this).parents('.order');
					var btnArray = ['否', '是'];
					mui.confirm('确认取消订单，确认？', '魏远商城', btnArray, function(e) {

						if(e.index == 1) {
							//				alert(thisid);
							$.ajax({
								url: ur + '/mobilemember/frontOrderOperation/cancel',
								type: 'post',
								headers: {
									"X-Token": localStorage.token
								},
								dataType: 'json',
								data: {
									"orderVO.id": thisid,
									/*"id": '40288051594f367a015963128b240033',*/
								},
								success: function(data) {
//									alert(3)
									console.log(data);
									//							all.fadeOut(1000);
									mui.toast('取消订单成功');
									//刷新
									updataallsx()
								},
								error: function(data) {

									console.log(data);
								}
							})
						}
					})
				} else if(tai == 2||tai == 19) {
					/*退款*/
					var thisid2 = $(this).parents('.order').attr('oid');
					localStorage.backmonm = thisid2;
					console.log($(this));
					mui.openWindow({
						url: 'refoundmon.html',
						id: 'refoundmon',
						show: 'pop-in'
					});
				} else if(tai == 3) {
					/*确认收货*/
					localStorage.lookorderid = $(this).parents('.order').attr('oid');
					mui.openWindow({
						url: 'my-logistics.html',
						id: 'my-logistics',
						show: 'pop-in'
					});
				} else if(tai == 5) {
					/*删除订单*/
					var thisid5 = $(this).parents('.order').attr('oid');
					//                    console.log($(this));
					//                    alert(thisid);
					var all5 = $(this).parents('.order');
					var btnArray = ['否', '是'];
					mui.confirm('确认删除订单，确认？', '魏远商城', btnArray, function(e) {
						if(e.index == 1) {
							//						alert(thisid5);
							$.ajax({
								url: ur + '/mobilemember/frontOrderOperation/orderByDel',
								type: 'post',
								headers: {
									"X-Token": localStorage.token
								},
								dataType: 'json',
								data: {
									"orderVO.id": thisid5,
								},
								success: function(data) {
									console.log(data);
									all5.fadeOut(1000);
									mui.toast('删除订单成功');
									var n = $('#b3').text();
									$('#b3').text(parseInt(n) - 1)
									if($('#b3').text() == 0){
										$('#b3').css('display','none')
									}else{
										$('#b3').css('display','block')
									}
									console.log(parseInt(n) - 1+'数量')
//									var n = $('#b3').text();
//									$('#b3').text(parseInt(n) - 1)
//									console.log(parseInt(n) - 1+'数量')
								},
								error: function(data) {
									console.log(data);
								}
							})
						}
					})
				} else if(tai == 11) {
					
					/*删除订单*/
					var thisid11 = $(this).parents('.order').attr('oid');
					console.log($(this));
					//                    alert(thisid);
					var all11 = $(this).parents('.order');
					var btnArray = ['否', '是'];
					mui.confirm('确认删除订单，确认？', '魏远商城', btnArray, function(e) {
							
						if(e.index == 1) {
							//				alert(thisid);
							$.ajax({
								url: ur + '/mobilemember/frontOrderOperation/orderByDel',
								type: 'post',
								headers: {
									"X-Token": localStorage.token
								},
								dataType: 'json',
								data: {
									"orderVO.id": thisid11,
									/*"id": '40288051594f367a015963128b240033',*/
								},
								success: function(data) {
									console.log(data);
									all11.fadeOut(1000);
									mui.toast('删除订单成功');
									var n = $('#b3').text();
									$('#b3').text(parseInt(n) - 1);
									if($('#b3').text() == 0){
										$('#b3').css('display','none')
									}else{
										$('#b3').css('display','block')
									}
									console.log(parseInt(n) - 1+'数量')
								},
								error: function(data) {
									console.log(data);
								}
							})
						}else{
							
						}
					})
				}
			});


			/*第二个按钮点击*/
			$('.mui-slider-group').on('tap', '.payment', function(event) {
				event.stopPropagation();
				var tai = $(this).attr('tai');
				if(tai == 1) {
					/*去到付款*/
					localStorage.alltimes = $(this).parents('.order').find('.howjian').text();
					localStorage.allpriceall = $(this).parents('.order').find('.order-total').text();
					localStorage.sureorder = $(this).parents('.order').attr('Nid');
					localStorage.sureorderid = $(this).parents('.order').attr('oid');
					//				 	alert(localStorage.alltimes );
					//					alert(localStorage.sureorder);
					mui.openWindow({
						url: 'sure.html',
						id: 'sure',
						show: 'pop-in'
					});

				} else if(tai == 2 || tai == 19) {

					/*发货提醒*/
					var thisid2 = $(this).parents('.order').attr('oid');
					console.log($(this));
					//                    alert(thisid);
					var all2 = $(this).parents('.order');
					var btnArray = ['否', '是'];
					mui.confirm('确认提醒发货，确认？', '魏远商城', btnArray, function(e) {
						if(e.index == 1) {
							//				alert(thisid);
							$.ajax({
								url: ur + '/mobilemember/frontOrderOperation/remind',
								type: 'post',
								headers: {
									"X-Token": localStorage.token
								},
								dataType: 'json',
								data: {
									"orderByRemindId": thisid2,
									/*"id": '40288051594f367a015963128b240033',*/
								},
								success: function(data) {
									console.log(data);
									//							all.fadeOut(1000);
									mui.toast('已为您发送提醒信息');
									updataallsx();
								},
								error: function(data) {
									console.log(data);
								}
							})

						}
					})
				} else if(tai == 3) {
					/*确认收货*/
					var thisid3 = $(this).parents('.order').attr('oid');
					console.log($(this));
					//                    alert(thisid);
					var all3 = $(this).parents('.order');
					var btnArray = ['否', '是'];
					mui.confirm('确认收货，确认？', '魏远商城', btnArray, function(e) {
						if(e.index == 1) {
							//				alert(thisid);
							$.ajax({
								url: ur + '/mobilemember/frontOrderOperation/confirmReceipt',
								type: 'post',
								headers: {
									"X-Token": localStorage.token
								},
								dataType: 'json',
								data: {
									"orderVO.id": thisid3,
									/*"id": '40288051594f367a015963128b240033',*/
								},
								success: function(data) {
									console.log(data);
									//							all.fadeOut(1000);
									mui.toast('确认收货成功');
									updataallsx();
								},
								error: function(data) {
									console.log(data);
								}
							})
						}
					})
				} else if(tai == 5) {
					localStorage.sureorderid = $(this).parents('.order').attr('oid');
					mui.openWindow({
						url: 'evaluate.html',
						id: 'evaluate',
						show: 'pop-in'
					});
				}

			})
			/*删除订单*/
			//          function delteorder(){
			//                    var thisid = $(this).parents('.order').attr('oid');
			//                    console.log($(this));
			//                    alert(thisid);
			//				      var all = $(this).parents('.order');
			//				var btnArray = ['否', '是'];
			//				mui.confirm('确认取消订单，确认？', '魏远商城', btnArray, function(e) {
			//				if (e.index == 1) {
			////				alert(thisid);
			//					$.ajax({
			//						url: ur + '/mobilemember/frontOrderOperation/cancel',
			//						type: 'post',
			//						headers: {
			//							"X-Token": localStorage.token
			//						},
			//						dataType: 'json',
			//						data: {
			//							"orderVO.id": thisid,
			//							/*"id": '40288051594f367a015963128b240033',*/
			//						},
			//						success: function(data){
			//							console.log(data);
			////							all.fadeOut(1000);
			//							mui.toast('删除成功');
			//						},
			//						error: function(data){
			//							console.log(data);
			//						}
			//					})
			//						
			//				}
			//			})
			//			}
			//立即支付
			//			document.getElementById("payment").addEventListener('tap', function() {
			//					mui.openWindow({
			//						url: '',
			//						id: ''
			//					})
			//				})
			//取消订单order1
			$("#cancel").on('tap', function() {
				//				alert(1111);
				var btnArray = ['否', '是'];
				mui.confirm('确定取消订单？', '提示', btnArray, function(e) {
					//					alert(22);
					if(e.index == 1) {
						$('#order1').remove();
					} else {

					}
				})
			});
			//提醒发货
			//			document.getElementById("remind").getEventListener('tap',function(){
			//				mui.toast('已提醒卖家发货');
			//			})
			//查看物流
			$('.logistics').on('tap', function() {
				mui.openWindow({
					url: 'my-logistics.html',
					id: 'my-logistics',
					show: 'pop-in'
				})
			})
			//待评价
			$('#evaluate').on('tap', function() {
				mui.openWindow({
					url: 'evaluate.html',
					id: 'evaluate',
					show: 'pop-in'
				})
			})
		</script>
	</body>

</html>